﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace RouterControl.WhsAddIn.SettingsControls
{
	public partial class EnableTrafficGraph : SettingsControlBase
	{
		public EnableTrafficGraph(RouterControlSettingsTab2 tab)
			: base(tab)
		{
			InitializeComponent();

			this.lineBox.Header.Text = Properties.Resources.txtSettingTrafficGraph;
		}

		private void enableTrafficGraphCB_CheckedChanged(object sender, EventArgs e)
		{
			// any change?
			if (this.enableTrafficGraphCB.Checked == _tab.Settings.EnableTrafficGraph)
				return;

			// save settings
			_tab.Settings.EnableTrafficGraph = this.enableTrafficGraphCB.Checked;

			_tab.Services.EnableSettingsApply();
		}

		private void EnableTrafficGraph_Load(object sender, EventArgs e)
		{
			// load settings
			this.enableTrafficGraphCB.Checked = _tab.Settings.EnableTrafficGraph;
		}
	}
}
